\(\int \sqrt {a+b \sin (e+f x)} \, dx\) [204]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [C] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 14, antiderivative size = 62 \[ \int \sqrt {a+b \sin (e+f x)} \, dx=\frac {2 E\left (\frac {1}{2} \left (e-\frac {\pi }{2}+f x\right )|\frac {2 b}{a+b}\right ) \sqrt {a+b \sin (e+f x)}}{f \sqrt {\frac {a+b \sin (e+f x)}{a+b}}} \]

[Out]

-2*(sin(1/2*e+1/4*Pi+1/2*f*x)^2)^(1/2)/sin(1/2*e+1/4*Pi+1/2*f*x)*EllipticE(cos(1/2*e+1/4*Pi+1/2*f*x),2^(1/2)*(
b/(a+b))^(1/2))*(a+b*sin(f*x+e))^(1/2)/f/((a+b*sin(f*x+e))/(a+b))^(1/2)

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {2734, 2732} \[ \int \sqrt {a+b \sin (e+f x)} \, dx=\frac {2 \sqrt {a+b \sin (e+f x)} E\left (\frac {1}{2} \left (e+f x-\frac {\pi }{2}\right )|\frac {2 b}{a+b}\right )}{f \sqrt {\frac {a+b \sin (e+f x)}{a+b}}} \]

[In]

Int[Sqrt[a + b*Sin[e + f*x]],x]

[Out]

(2*EllipticE[(e - Pi/2 + f*x)/2, (2*b)/(a + b)]*Sqrt[a + b*Sin[e + f*x]])/(f*Sqrt[(a + b*Sin[e + f*x])/(a + b)
])

Rule 2732

Int[Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[2*(Sqrt[a + b]/d)*EllipticE[(1/2)*(c - Pi/2
+ d*x), 2*(b/(a + b))], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0] && GtQ[a + b, 0]

Rule 2734

Int[Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Dist[Sqrt[a + b*Sin[c + d*x]]/Sqrt[(a + b*Sin[c +
 d*x])/(a + b)], Int[Sqrt[a/(a + b) + (b/(a + b))*Sin[c + d*x]], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 -
 b^2, 0] &&  !GtQ[a + b, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\sqrt {a+b \sin (e+f x)} \int \sqrt {\frac {a}{a+b}+\frac {b \sin (e+f x)}{a+b}} \, dx}{\sqrt {\frac {a+b \sin (e+f x)}{a+b}}} \\ & = \frac {2 E\left (\frac {1}{2} \left (e-\frac {\pi }{2}+f x\right )|\frac {2 b}{a+b}\right ) \sqrt {a+b \sin (e+f x)}}{f \sqrt {\frac {a+b \sin (e+f x)}{a+b}}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.10 (sec) , antiderivative size = 61, normalized size of antiderivative = 0.98 \[ \int \sqrt {a+b \sin (e+f x)} \, dx=-\frac {2 E\left (\frac {1}{4} (-2 e+\pi -2 f x)|\frac {2 b}{a+b}\right ) \sqrt {a+b \sin (e+f x)}}{f \sqrt {\frac {a+b \sin (e+f x)}{a+b}}} \]

[In]

Integrate[Sqrt[a + b*Sin[e + f*x]],x]

[Out]

(-2*EllipticE[(-2*e + Pi - 2*f*x)/4, (2*b)/(a + b)]*Sqrt[a + b*Sin[e + f*x]])/(f*Sqrt[(a + b*Sin[e + f*x])/(a
+ b)])

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(238\) vs. \(2(91)=182\).

Time = 2.97 (sec) , antiderivative size = 239, normalized size of antiderivative = 3.85

method result size
default \(\frac {2 \left (a -b \right ) \sqrt {\frac {a +b \sin \left (f x +e \right )}{a -b}}\, \sqrt {-\frac {\left (\sin \left (f x +e \right )-1\right ) b}{a +b}}\, \sqrt {-\frac {\left (\sin \left (f x +e \right )+1\right ) b}{a -b}}\, \left (a F\left (\sqrt {\frac {a +b \sin \left (f x +e \right )}{a -b}}, \sqrt {\frac {a -b}{a +b}}\right )+F\left (\sqrt {\frac {a +b \sin \left (f x +e \right )}{a -b}}, \sqrt {\frac {a -b}{a +b}}\right ) b -E\left (\sqrt {\frac {a +b \sin \left (f x +e \right )}{a -b}}, \sqrt {\frac {a -b}{a +b}}\right ) a -E\left (\sqrt {\frac {a +b \sin \left (f x +e \right )}{a -b}}, \sqrt {\frac {a -b}{a +b}}\right ) b \right )}{b \cos \left (f x +e \right ) \sqrt {a +b \sin \left (f x +e \right )}\, f}\) \(239\)
risch \(\text {Expression too large to display}\) \(1514\)

[In]

int((a+b*sin(f*x+e))^(1/2),x,method=_RETURNVERBOSE)

[Out]

2*(a-b)*((a+b*sin(f*x+e))/(a-b))^(1/2)*(-(sin(f*x+e)-1)*b/(a+b))^(1/2)*(-(sin(f*x+e)+1)*b/(a-b))^(1/2)/b*(a*El
lipticF(((a+b*sin(f*x+e))/(a-b))^(1/2),((a-b)/(a+b))^(1/2))+EllipticF(((a+b*sin(f*x+e))/(a-b))^(1/2),((a-b)/(a
+b))^(1/2))*b-EllipticE(((a+b*sin(f*x+e))/(a-b))^(1/2),((a-b)/(a+b))^(1/2))*a-EllipticE(((a+b*sin(f*x+e))/(a-b
))^(1/2),((a-b)/(a+b))^(1/2))*b)/cos(f*x+e)/(a+b*sin(f*x+e))^(1/2)/f

Fricas [C] (verification not implemented)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 0.11 (sec) , antiderivative size = 363, normalized size of antiderivative = 5.85 \[ \int \sqrt {a+b \sin (e+f x)} \, dx=\frac {\sqrt {2} a \sqrt {i \, b} {\rm weierstrassPInverse}\left (-\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 i \, a^{3} - 9 i \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (f x + e\right ) - 3 i \, b \sin \left (f x + e\right ) - 2 i \, a}{3 \, b}\right ) + \sqrt {2} a \sqrt {-i \, b} {\rm weierstrassPInverse}\left (-\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (-8 i \, a^{3} + 9 i \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (f x + e\right ) + 3 i \, b \sin \left (f x + e\right ) + 2 i \, a}{3 \, b}\right ) - 3 i \, \sqrt {2} \sqrt {i \, b} b {\rm weierstrassZeta}\left (-\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 i \, a^{3} - 9 i \, a b^{2}\right )}}{27 \, b^{3}}, {\rm weierstrassPInverse}\left (-\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 i \, a^{3} - 9 i \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (f x + e\right ) - 3 i \, b \sin \left (f x + e\right ) - 2 i \, a}{3 \, b}\right )\right ) + 3 i \, \sqrt {2} \sqrt {-i \, b} b {\rm weierstrassZeta}\left (-\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (-8 i \, a^{3} + 9 i \, a b^{2}\right )}}{27 \, b^{3}}, {\rm weierstrassPInverse}\left (-\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (-8 i \, a^{3} + 9 i \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (f x + e\right ) + 3 i \, b \sin \left (f x + e\right ) + 2 i \, a}{3 \, b}\right )\right )}{3 \, b f} \]

[In]

integrate((a+b*sin(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

1/3*(sqrt(2)*a*sqrt(I*b)*weierstrassPInverse(-4/3*(4*a^2 - 3*b^2)/b^2, -8/27*(8*I*a^3 - 9*I*a*b^2)/b^3, 1/3*(3
*b*cos(f*x + e) - 3*I*b*sin(f*x + e) - 2*I*a)/b) + sqrt(2)*a*sqrt(-I*b)*weierstrassPInverse(-4/3*(4*a^2 - 3*b^
2)/b^2, -8/27*(-8*I*a^3 + 9*I*a*b^2)/b^3, 1/3*(3*b*cos(f*x + e) + 3*I*b*sin(f*x + e) + 2*I*a)/b) - 3*I*sqrt(2)
*sqrt(I*b)*b*weierstrassZeta(-4/3*(4*a^2 - 3*b^2)/b^2, -8/27*(8*I*a^3 - 9*I*a*b^2)/b^3, weierstrassPInverse(-4
/3*(4*a^2 - 3*b^2)/b^2, -8/27*(8*I*a^3 - 9*I*a*b^2)/b^3, 1/3*(3*b*cos(f*x + e) - 3*I*b*sin(f*x + e) - 2*I*a)/b
)) + 3*I*sqrt(2)*sqrt(-I*b)*b*weierstrassZeta(-4/3*(4*a^2 - 3*b^2)/b^2, -8/27*(-8*I*a^3 + 9*I*a*b^2)/b^3, weie
rstrassPInverse(-4/3*(4*a^2 - 3*b^2)/b^2, -8/27*(-8*I*a^3 + 9*I*a*b^2)/b^3, 1/3*(3*b*cos(f*x + e) + 3*I*b*sin(
f*x + e) + 2*I*a)/b)))/(b*f)

Sympy [F]

\[ \int \sqrt {a+b \sin (e+f x)} \, dx=\int \sqrt {a + b \sin {\left (e + f x \right )}}\, dx \]

[In]

integrate((a+b*sin(f*x+e))**(1/2),x)

[Out]

Integral(sqrt(a + b*sin(e + f*x)), x)

Maxima [F]

\[ \int \sqrt {a+b \sin (e+f x)} \, dx=\int { \sqrt {b \sin \left (f x + e\right ) + a} \,d x } \]

[In]

integrate((a+b*sin(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

integrate(sqrt(b*sin(f*x + e) + a), x)

Giac [F]

\[ \int \sqrt {a+b \sin (e+f x)} \, dx=\int { \sqrt {b \sin \left (f x + e\right ) + a} \,d x } \]

[In]

integrate((a+b*sin(f*x+e))^(1/2),x, algorithm="giac")

[Out]

integrate(sqrt(b*sin(f*x + e) + a), x)

Mupad [B] (verification not implemented)

Time = 6.30 (sec) , antiderivative size = 55, normalized size of antiderivative = 0.89 \[ \int \sqrt {a+b \sin (e+f x)} \, dx=\frac {2\,\mathrm {E}\left (\frac {e}{2}-\frac {\pi }{4}+\frac {f\,x}{2}\middle |\frac {2\,b}{a+b}\right )\,\sqrt {a+b\,\sin \left (e+f\,x\right )}}{f\,\sqrt {\frac {a+b\,\sin \left (e+f\,x\right )}{a+b}}} \]

[In]

int((a + b*sin(e + f*x))^(1/2),x)

[Out]

(2*ellipticE(e/2 - pi/4 + (f*x)/2, (2*b)/(a + b))*(a + b*sin(e + f*x))^(1/2))/(f*((a + b*sin(e + f*x))/(a + b)
)^(1/2))